<!DOCTYPE HTML>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head th:include="console/header">
</head>
<body>
<section class="content-header">
    <h1>报表-明细</h1>
</section>
<section class="content table-content">
    <table id="dataGrid"></table>
</section>

<div th:include="console/footer"></div>
</body>
<script type="text/javascript">
    $table = $("#dataGrid");
    $(function () {
        initDataGrid();
    });
    function initDataGrid(){
        $table.bootstrapTable({
            height : tableModel.getHeight(),
            idField : "id",
            columns : [[
                {title: "记账日期", field: "totalDate" },
                {title: "科目编码", field: "debitAccountCode"},
                {title: "科目名称", field: "debitAccount"},
                {title: "借方", field: "debitTotal"},
                {title: "贷方", field: "loanTotal"},
                {title: "余额", field: "over"},
            ]],
            url : '/console/accountDetails/list',
            queryParams: function(params){
                return params;
            },
            responseHandler : function (res) {
                return {
                    rows : res.result.pageInfo.list,
                    total : res.result.pageInfo.total
                }
            },
            search : true,
            searchOnEnterKey : true,
            sortName : 'totalDate',
            sortOrder : 'asc',
            pagination : true,
            sidePagination : 'server',
            pageSize: 20,
            pageList : [20, 40, 50, 100],
            toolbar : "#toolbar",
            showRefresh : true,
            showToggle : true
        });
    }

    function getRole(value,row,index) {
        if(row.isSystem == 1){
            return "超级管理（不受角色限制）"
        }else{
            return $.map(value,function (v) {
                return v.roleName;
            }).join(",");
        }

    }

</script>
</html>